package com.jingwu.example.pojo.query;

import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Data;

/**
 * @author jingwu
 * @since  2021/2/3
 */
@Data
public abstract class BasePaginationRequest {
    private Integer index = 1;
    private Integer size = 20;

    @JsonIgnore
    public Integer getOffset() {
        return getSize() * (getIndex() - 1);
    }

    @JsonIgnore
    public Integer getLimit() {
        return getSize();
    }
}
